package com.tong.lettuce.lock.test.service;

import com.tong.lettuce.lock.annotation.RedisLock;
import org.springframework.stereotype.Service;

@Service
public class RedisLockDemoServiceImpl implements RedisLockDemoService {
    @Override
    @RedisLock(lockName = "order", lockKey = "#id", expireSeconds = 30)
    public void doSomething(long id) throws InterruptedException {
        System.out.println("doSomething execute start...");
        Thread.sleep(20000);
        System.out.println("doSomething execute finished...");
    }
}
